package top.jiangqiang.crawler.core.http.entities;

import org.jetbrains.annotations.NotNull;
import top.jiangqiang.crawler.core.constants.RequestMethod;

import java.io.Serializable;

/**
 * 目前仅使用method
 * @param method  请求方式 GET, POST等。
 * @param path    路径 /index.html?a=1&b=1
 * @param version 版本号HTTP/1.1, HTTP/2 等。一般为HTTP/1.1
 */
public record RequestLine(RequestMethod method, String path, String version) implements Serializable {

    public RequestLine(@NotNull RequestMethod method) {
        this(method, "", "");
    }

    public RequestLine() {
        this(RequestMethod.GET, "", "");
    }
}
